Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow cross-compiling AOT snapshots in benchmark builder #701

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

osa1
Copy link
Member

@osa1 osa1 commented Jul 8, 2022

In #698 we forgot to add cross-compilation support to benchmark builder, which
broke Golem.

This PR implements cross compilation support for AOT snapshots.

Changes:

  • AOT target is no longer enabled by default

  • When using --target=aot, we now expect one extra parameter and one env variable:

    • --aot-target=[x64|armv7hf|armv8] target platform of the snapshot

    • $DART_SDK env variable specifies the SDK path. We use this path to invoke
      precompiler2.

We could avoid adding --aot-target with a syntax like --target=aot=x64. I
don't know how common this syntax is.

Path to Dart SDK is an env variable as in my experience you usually set it in
your shell rc and we have other dev tools that expect DART_SDK to be set.

@mkustermann @sigurdm any thoughts?

}

/// Maps `--aot-target` arguments to their [AotTarget]s
const aotTargets = <String, AotTarget>{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(to avoid duplication you could use AotTarget.values and their string representation)

});
});
}

const aotTarget = Target('aot', aotProcessArgs);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this aotTarget and aotProcessArgs unused now?

return Target('aot', (sourceFile) {
final baseName = path.basename(sourceFile);
final baseNameNoExt = path.withoutExtension(baseName);
// TODO: Do we need `-Ddart.vm.product=true`?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants